package com.luoke.util;

public class StringUtils {
    public static String padRight(String str, int width) {
        if (str == null) str = "";
        return String.format("%-" + width + "s", str); // 右侧补齐
    }

    public static String padLeft(String str, int width) {
        if (str == null) str = "";
        return String.format("%" + width + "s", str); // 左侧补齐
    }
}
